package moon.core;

/**
 * Named object. Each object has an unique identificative name.
 * 
 * @author <a href="mailto:rmartico@ubu.es">Ra&uacute;l Marticorena</a>
 * @since JavaMoon-2.0
 */
@SuppressWarnings("serial")
public abstract class NamedObject extends ObjectMoon{
	
	/**
	 * Simple name.
	 */
	private Name name;
	
	/**
	 * Gets the unique name.
	 * 
	 * @return unique name
	 */
	public abstract Name getUniqueName();
	
	/**
	 * Gets the simple name of the object.
	 * @return simple name
	 * @see #setName
	 */
	public Name getName() { 
		return name; 
	}
	
	/**
	 * Sets the simple name.
	 * 
	 * @param name simple name
	 * @see #getName
	 */
	public void setName(Name name){
		assert name != null : "Not allowed a null value.";
		this.name = name;
	}	
	
	/**
	 * Named object.
	 * 
	 * @param name simple name
	 */
	public NamedObject(Name name){		
		setName(name);
	}
	
} // NamedObject
